function selectTypeAll(input)
{
	var l = input.parentNode;
	while(l)
	{
		l = DOM.next(l, 'DIV');
		if(!l)
		{
			break;
		}
		var input2 = DOM.firstChild(l, 'INPUT');
		if(input2) 
		{
			input2.checked = input.checked;
		}
	}
}

function operInfo(oper_id)
{
	var w = Math.round($(window).width() / 2);
	openPop(w - 30);
	var pop = document.getElementById('pop');
	pop.style.width = ((w - 60) * 2) + 'px';
	pop.style.marginLeft = '-' + (w - 30) + 'px';
	pop.style.top = '50px';
	pop.style.bottom = '50px';
	var frame = document.createElement('IFRAME')
	frame.width = '100%';
	frame.height = '100%';
	frame.frameborder = 0;
	frame.src = base_url + 'oper/info/' + oper_id;
	frame.style.border = 'none';
	pop.appendChild(frame);
	document.getElementById('pop_close').style.top = '34px';
}

function openPlatezhRelation(oper_id)
{
	var w = Math.round($(window).width() / 2);
	openPop(w - 30);
	var pop = document.getElementById('pop');
	pop.style.width = ((w - 60) * 2) + 'px';
	pop.style.marginLeft = '-' + (w - 30) + 'px';
	pop.style.top = '50px';
	pop.style.bottom = '50px';
	var frame = document.createElement('IFRAME')
	frame.width = '100%';
	frame.height = '100%';
	frame.frameborder = 0;
	frame.src = base_url + 'oper/platezh_relation/' + oper_id;
	frame.style.border = 'none';
	pop.appendChild(frame);
	document.getElementById('pop_close').style.top = '34px';
}

function _getStrByCheckboxes(parent_id)
{
	var structure = document.getElementById(parent_id);
	var div = DOM.firstChild(structure, 'DIV');
	var out = '';
	while(div = DOM.next(div, "DIV"))
	{
		var ch = DOM.firstChild(div, 'INPUT');
		if(ch &&  ch.type == 'checkbox' && ch.checked) 
		{
			out += (out ? "-" : '') + ch.value;
		}
	}
	return out;
}

function submFilter(f)
{
	f.u.value = _getStrByCheckboxes('structure');
	f.t.value = _getStrByCheckboxes('types');
	f.submit();
}

